local EntityManager={}
function EntityManager.addEntity(world,Entity)--添加
  assert(world~=nil, "no world to add")
  assert(Entity~=nil,"no system to add")
  for _, traverseEntity in ipairs(world.entities) do
    if(traverseEntity==Entity) then
      return false
    end
  end
  table.insert(world.entities,Entity)
  return true
end

function EntityManager.deleteEntity(world,Entity)--删除
  assert(world~=nil,"no world exist")
  local pos=0
  for i,traverseEntity in ipairs(world.entities) do
    if(Entity==traverseEntity) then
      pos=i
    end
  end
  if(pos==0) then
    return false
  end
  table.remove(world.entities,pos)
  return true
end

function EntityManager.checkEntity(world,Entity)--查
  assert(world~=nil, "no world exist")
  assert(Entity~=nil, "invalid input")
  if(world.entities.Entity~=nil) then
    return true
  end
  return false
end
return EntityManager